package exemplo.model;

public class Product implements java.io.Serializable{

	private static final long serialVersionUID = 1L;
	
	private int code;
	private String name;
	private int numberOfItens;
	private double price;
	
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getNumberOfItens() {
		return numberOfItens;
	}
	public void setNumberOfItens(int numberOfItens) {
		this.numberOfItens = numberOfItens;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	@Override
	public String toString() {
		return Integer.valueOf(code).toString();
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + code;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Product other = (Product) obj;
		if (code != other.code)
			return false;
		return true;
	}
	
	
}
